﻿@model IEnumerable<Scrumrun.Models.UserStory>

@{
    ViewBag.Title = "SprintBoard";
}

<h3>Scrum board</h3>
<h4>@ViewBag.currentSprint</h4>

<div class="row mainwrapper">
    <div class="span4 boardList">
        <h5>To Do</h5>
        <div id="ToDoDiv">
            <ul id="ToDoDrop" class="dropList ui-helper-reset ui-helper-clearfix" data-statusid="@ViewBag.ToDoStatus">
                @foreach (var item in Model)
                {
                    if (item.ItemStatus_ItemStatusId == ViewBag.ToDoStatus)
                    {
                    <li class="ui-widget-content ui-corner-all" data-userstoryid="@item.Id">
                        <h5 class="ui-widget-header">@(item.UserProfile == null ? "" : item.UserProfile.UserName)</h5>
                        @item.Title
                    </li>
                    }
                }
            </ul>
        </div>
    </div>
    <div class="span4 boardList">
        <h5>In progress</h5>
        <div id="progressDiv">
            <ul id="progressDrop" class="dropList ui-helper-reset ui-helper-clearfix" data-statusid="@ViewBag.InProgress">
                @foreach (var item in Model)
                {
                    if (item.ItemStatus_ItemStatusId == ViewBag.InProgress)
                    {
                    <li class="ui-widget-content ui-corner-all" data-userstoryid="@item.Id">
                        <h5 class="ui-widget-header">@(item.UserProfile == null ? "" : item.UserProfile.UserName)</h5>
                        @item.Title
                    </li>
                    }
                }
            </ul>
        </div>
    </div>
    <div class="span4 boardList">
        <h5>Done</h5>
        <div id="doneDiv">
            <ul id="doneDrop" class="dropList ui-helper-reset ui-helper-clearfix" data-statusid="@ViewBag.Done">
                @foreach (var item in Model)
                {
                    if (item.ItemStatus_ItemStatusId == ViewBag.Done)
                    {
                    <li class="ui-widget-content ui-corner-all" data-userstoryid="@item.Id">
                        <h5 class="ui-widget-header">@(item.UserProfile == null ? "" : item.UserProfile.UserName)</h5>
                        @item.Title
                    </li>
                    }
                }
            </ul>
        </div>
    </div>
</div>


@Html.Hidden("SetStatusUrl",Url.Action("SetStatus","Sprint"));